#include <stdio.h>
#include <iostream>
#include <pthread.h>
#include <sys/syscall.h>//获取线程id的系统调用头文件
#include <sys/types.h>
#include <unistd.h>

using namespace std;

void* thread_func(void*)
{
    //获取线程id的系统调用
//    cout << syscall(__NR_gettid) << endl;
while(1)
{
	sleep(1);
	printf("t1\n");
}	
   sleep(1); 
 //   return NULL;
}


int main(int argc, char *argv[])
{
    pthread_t t1, t2;
    pthread_create(&t1, NULL, thread_func, NULL);
    cout << t1 << endl;
//    pthread_join(t1, NULL);

    pthread_create(&t2, NULL, thread_func, NULL);
    cout << t2 << endl;
    pthread_join(t2, NULL);
    return 0;
}
